package ar.com.ford.it.fullEconomics.persistence.dao.query;

import oracle.toplink.expressions.Expression;
import oracle.toplink.expressions.ExpressionBuilder;
import ar.com.ford.it.fullEconomics.persistence.dto.Teesc07Subcstitem;
import com.ford.it.persistence.impl.toplink.CustomExpressionFactory;

public class SubCostStructureItemsFindQuery implements CustomExpressionFactory {

    public Expression createExpression(ExpressionBuilder builder,
                                       Object[] parameters) {
        Teesc07Subcstitem subCostStrItem = (Teesc07Subcstitem) parameters[0];
        Expression exp = null;
        
        exp = builder.get("eesc07PlantCodeC").equal(subCostStrItem.getEesc07PlantCodeC());
        exp = exp.and(builder.get("teesc03Subcoststr").equal(subCostStrItem.getTeesc03Subcoststr()));
        exp = exp.and(builder.get("teesc06Item").get("eesc06ItemIndexedFlagF").equal(subCostStrItem.getTeesc06Item().getEesc06ItemIndexedFlagF())); 
                
        return exp;
    }

}
